package com.ruoyi.swla2.service.impl;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.swla2.domain.DfqFreeze;
import com.ruoyi.swla2.model.DmaLeakageCompositionModel;
import com.ruoyi.swla2.model.DmaMinNightFlowModel;
import com.ruoyi.swla2.model.DmaPressureDataModel;
import com.ruoyi.swla2.model.FreezeDataQueryModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.swla2.mapper.DmaFreezeMapper;
import com.ruoyi.swla2.domain.DmaFreeze;
import com.ruoyi.swla2.service.IDmaFreezeService;

/**
 * dma冻结数据Service业务层处理
 *
 * @author gdqt
 * @date 2023-08-28
 */
@Service
public class DmaFreezeServiceImpl implements IDmaFreezeService {
    @Autowired
    private DmaFreezeMapper dmaFreezeMapper;

    /**
     * 查询dma冻结数据
     *
     * @param id dma冻结数据主键
     * @return dma冻结数据
     */
    @Override
    public DmaFreeze selectDmaFreezeById(String id) {
        return dmaFreezeMapper.selectDmaFreezeById(id);
    }

    /**
     * 查询dma冻结数据列表
     *
     * @param dmaFreeze dma冻结数据
     * @return dma冻结数据
     */
    @Override
    public List<DmaFreeze> selectDmaFreezeList(DmaFreeze dmaFreeze) {
        return dmaFreezeMapper.selectDmaFreezeList(dmaFreeze);
    }

    /**
     * 新增dma冻结数据
     *
     * @param dmaFreeze dma冻结数据
     * @return 结果
     */
    @Override
    public int insertDmaFreeze(DmaFreeze dmaFreeze) {
        dmaFreeze.setCreateTime(DateUtils.getNowDate());
        return dmaFreezeMapper.insertDmaFreeze(dmaFreeze);
    }

    /**
     * 修改dma冻结数据
     *
     * @param dmaFreeze dma冻结数据
     * @return 结果
     */
    @Override
    public int updateDmaFreeze(DmaFreeze dmaFreeze) {
        return dmaFreezeMapper.updateDmaFreeze(dmaFreeze);
    }

    /**
     * 批量删除dma冻结数据
     *
     * @param ids 需要删除的dma冻结数据主键
     * @return 结果
     */
    @Override
    public int deleteDmaFreezeByIds(String[] ids) {
        return dmaFreezeMapper.deleteDmaFreezeByIds(ids);
    }

    /**
     * 删除dma冻结数据信息
     *
     * @param id dma冻结数据主键
     * @return 结果
     */
    @Override
    public int deleteDmaFreezeById(String id) {
        return dmaFreezeMapper.deleteDmaFreezeById(id);
    }

    @Override
    public List<DmaFreeze> selectDmaFreezeByQueryModel(FreezeDataQueryModel model) {
        return dmaFreezeMapper.selectDmaFreezeByQueryModel(model);
    }

    @Override
    public DmaLeakageCompositionModel selectDmaLeakageComposition(Map<String, Object> paramMap) {
        return dmaFreezeMapper.selectDmaLeakageComposition(paramMap);
    }

    @Override
    public List<DmaFreeze> selectDmaMinNightFlow(Map<String, Object> paramMap) {
        return dmaFreezeMapper.selectDmaMinNightFlow(paramMap);
    }

    @Override
    public List<DmaPressureDataModel> selectDmaPressureData(Map<String, Object> paramMap) {
        return dmaFreezeMapper.selectDmaPressureData(paramMap);
    }

    @Override
    public List<DmaFreeze> selectDmaFreezeReportList(FreezeDataQueryModel model) {
        return dmaFreezeMapper.selectDmaFreezeReportList(model);
    }
}
